// 上传素材接口
import request from "@/utils/request";

// 新增图片
export function UploadPicture(data) {
  return request({
    url: "/system/admin/upload/pic",
    method: "post",
    headers: { "Content-Type": "multipart/form-data" },
    data,
  });
}

// 新增视频
export function UploadVideo(data) {
  return request({
    url: "/system/admin/upload/video",
    method: "post",
    headers: { "Content-Type": "multipart/form-data" },
    data,
  });
}

// 分片上传视频
export function UploadChunkVideo(data) {
  return request({
    url: "/system/admin/upload/chunkUploadVideo",
    method: "post",
    headers: { "Content-Type": "multipart/form-data" },
    data,
  });
}

// 合并分片数据
export function CompleteUpload(data) {
  return request({
    url: "/system/admin/upload/completeUpload",
    method: "post",
    data,
  });
}

// 新增文件
export function UploadDoc(data) {
  return request({
    url: "/system/admin/upload/doc",
    method: "post",
    headers: { "Content-Type": "multipart/form-data" },
    data,
  });
}

// 新增素材
export function AddResource(data) {
  return request({
    url: "/course/admin/resource/save",
    method: "post",
    data,
  });
}

// 查询素材列表
export function QueryResourcePage(data) {
  return request({
    url: "/course/admin/resource/page",
    method: "post",
    data,
  });
}

// 删除素材
export function DeleteResource(id) {
  return request({
    url: `/course/admin/resource/delete?id=${id}`,
    method: "delete",
  });
}
